from django.urls import path
from . import views

urlpatterns = [
    # 列表或过滤：GET  /api/v1/user-device-map/  （可带 ?user_id=xx 或 ?device_id=yy）
    path('', views.list_or_filter_mappings, name='list_or_filter_mappings'),

    # 创建映射： POST /api/v1/user-device-map/
    path('create/', views.create_mapping, name='create_mapping'),

    # 单条映射相关操作：
    #   GET    /api/v1/user-device-map/<int:user_id>/<int:device_id>/
    #   PUT    /api/v1/user-device-map/<int:user_id>/<int:device_id>/
    #   DELETE /api/v1/user-device-map/<int:user_id>/<int:device_id>/
    path('<int:user_id>/<int:device_id>/', views.retrieve_mapping, name='retrieve_mapping'),
    path('<int:user_id>/<int:device_id>/update/', views.update_mapping, name='update_mapping'),
    path('<int:user_id>/<int:device_id>/delete/', views.delete_mapping, name='delete_mapping'),
]
